home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
tutor
/
modula12.exe
/
LOCMOD1.MOD
< prev
next >
Wrap
Text File
|
1988-10-26
|
830b
|
30 lines
(* Chapter 13 - Program 1 *)
MODULE LocMod1;
FROM InOut IMPORT WriteString, WriteCard, WriteLn;
VAR Index : CARDINAL;
MODULE LocalStuff;
EXPORT GetNumber; (* Nothing else is visible outside *)
(* Nothing outside is visible here *)
VAR Counter : CARDINAL;
PROCEDURE GetNumber() : CARDINAL;
BEGIN
Counter := Counter + 3;
RETURN Counter;
END GetNumber;
BEGIN
Counter := 4; (* This is only run at load time *)
END LocalStuff;
BEGIN (* Main program *)
FOR Index := 1 TO 8 DO
WriteString("The count is now ");
WriteCard(GetNumber(),8);
WriteLn;
END; (* Do loop *)
END LocMod1.